import axios from 'axios';
import qs from 'qs';
import store from '@/store/index.js';
import {
	Message,
	MessageBox,
	Notification
} from 'element-ui';
import router from '@/router';
import md5 from 'js-md5';
import DOMPurify from 'dompurify';
// 正式地址-调试环境
export const host = "http://120.224.237.100:8886";			 
//测试地址
//export const host = "http://123.132.237.18:17394";
//正式地址-发布时候用
//export const host = "http://www.lygttg.com";
 //export const ApiBaseUrl1 = host+"/openApi-captcha/captchaImage";
 //测试用-后面得删除掉
 
/**
 * 测试地址
 */
export const ApiBaseUrl = host + '/openApi';


/**
 *  axios 配置
 */
axios.defaults.timeout = 30000;
//axios.defaults.withCredentials = true;  //允许跨域携带cookie信息

/**
 * 请求拦截器
 */
axios.interceptors.request.use(config => {
	//config.headers['authToken'] = store.state.token;
	//config.headers['ms_username'] = localStorage.getItem('ms_username');

	let timeStamp = (new Date()).valueOf(); //十三位的时间戳  或者(new Date()).getTime()
	config.headers['signtime'] = timeStamp;
	config.headers['sign'] = md5('cqjy2023' + timeStamp);

	if (store.state.user.token) {
		config.headers['token'] = store.state.user.token;
	}
	//console.log('config', config);
	return config;
}, error => {
	return Promise.reject(error);
});

/**
 * 响应拦截器
 */
axios.interceptors.response.use(
	response => {
		console.log('response', response);
		const code = response.status;
		if (code !== 200) {
			Notification.error({
				title: response.message
			});
			return Promise.reject('error');
		} else {
			return response;
		}
	},
	error => {
		let code = 0;
		console.log('error', error);
		try {
			code = error.response.data.status;
		} catch (e) {
			if (error.toString().indexOf('Error: timeout') !== -1) {
				// Notification.error({
				//     title: '网络请求超时',
				//     duration: 5000
				// })
				return Promise.reject(error);
			}
		}
		return Promise.reject(error);
	}
);

/**
 * post方法--json请求
 * @param {Object} url请求路径
 * @param {Object} data 入参
 */
export function postData(url, data) {
	return new Promise((resolve, reject) => {
		axios.post(url, data)
			.then(response => {
				resolve(response.data);
				//	console.log(response.data);
			}, err => {
				reject(err);
			})
			.catch(error => {
				reject(error);
			});
	});
}



export function postDatacheck(url, data) {
	return new Promise((resolve, reject) => {
		axios.get(url, data)
			.then(response => {
				resolve(response.data);
				//	console.log(response.data);
			}, err => {
				reject(err);
			})
			.catch(error => {
				reject(error);
			});
	});
}
/**
 * get方法--json请求
 * @param {Object} url请求路径
 * @param {Object} data 入参
 */
export function getData(url) {
	return new Promise((resolve, reject) => {
		axios.get(url)
			.then(response => {
				resolve(response.data);
				//	console.log(response.data);
			}, err => {
				reject(err);
			})
			.catch(error => {
				reject(error);
			});
	});
}
/**
 * get方法--json请求
 * @param {Object} url请求路径
 * @param {Object} data 入参
 */
export function getDataForcaptchaImage(url) {
	return new Promise((resolve, reject) => {
		axios.get(url, {
				responseType: 'blob'
			})
			.then(response => {
				resolve(URL.createObjectURL(response.data));
				//console.log(response.data);
			}, err => {
				reject(err);
			})
			.catch(error => {
				reject(error);
			});
	});
}

export default {
	/**
		 * 
		http://127.0.0.1:9999/openApi/talent/saveOnlineMessage
		 获取验证码
		 * @param {Object} params
		 */
	getVerificationCode(codeId) {
		return getDataForcaptchaImage(ApiBaseUrl + '/captcha/captchaImage?codeId=' + codeId);
	},
	/**获取首页banner
	 * @param {Object} params
	 */
	getBannerSlides(params) {

		return postData(ApiBaseUrl + '/homePage/getHomePage', params);
	},
	/**获取首页、企业实时新闻-(1)	特钢新闻
	 * @param {Object} params
	 */
	getEnterpriseTrends(params) {

		return postData(ApiBaseUrl + '/homePage/getEnterpriseTrends', params);
	},
	/**获取首页、企业实时新闻-(2)	公示公告
	 * @param {Object} params
	 */
	getPublicNotice(params) {
		return postData(ApiBaseUrl + '/homePage/getPublicNotice', params);
	},
	/**获取首页、企业实时新闻-(3)	视频展示
	 * @param {Object} params
	 */
	getVideoDisplay(params) {
		return postData(ApiBaseUrl + '/homePage/getVideoDisplay', params);
	},
	getBannerSlidess(params) {

		return postDatacheck("http://116.205.171.129:8087/uniapi/notice?noticeType=3" , params);
	},
	/**获取首页、3、党建资讯
	 * @param {Object} params
	 */
	getPartyInfo(params) {
		return postData(ApiBaseUrl + '/homePage/getPartyInfo', params);
	},


	/**获取首页、4、产品展厅
	 * @param {Object} params
	 */
	getProductMain(params) {
		return postData(ApiBaseUrl + '/homePage/getProductMain', params);
	},

	/**获取首页、6、荣誉
	 * @param {Object} params
	 */
	getEnterpriseHonor(params) {
		return postData(ApiBaseUrl + '/homePage/getEnterpriseHonor', params);
	},
	/**获取首页、6、荣誉
	 * @param {Object} params
	 */
	getCultureHome(params) {
		return postData(ApiBaseUrl + '/homePage/getCultureHome', params);
	},
	/**搜索页背景图
	 * @param {Object} params
	 */
	searchBgImage(params) {
		return postData(ApiBaseUrl + '/search/searchBgImage', params);
	},
	//--------------------------党建引领-----------------------------------------------
	/**
	 * 获取党建引领banner
	 * @param {Object} params
	 */
	getPartyInfoTopImage(params) {
		return postData(ApiBaseUrl + '/partyLead/getPartyInfoTopImage', params);
	},

	/**
	 * http://127.0.0.1:9999/openApi/partyLead/getPartyInfoList
	 * 获取党建资讯分页列表
	 * @param {Object} params
	 */
	getPartyInfoList(params) {
		return postData(ApiBaseUrl + '/partyLead/getPartyInfoList', params);
	},
	/**
	 * http://127.0.0.1:9999/openApi/partyLead/getPartyInfoList
	 * 获取党建资讯分页列表
	 * @param {Object} params
	 */
	getPartyInfoPage(params) {
		return postData(ApiBaseUrl + '/partyLead/getPartyInfoPage', params);
	},
	/**
	 * 获取党建资讯详情
	 * @param {Object} params
	 */
	getPartyInfoDetail(params) {
		return postData(ApiBaseUrl + '/partyLead/getPartyInfoDetail', params);
	},
	/**
	 * 获取组织建设顶部背景
	 * @param {Object} params
	 */
	getOrgBuildTopImage(params) {
		return postData(ApiBaseUrl + '/partyLead/getOrgBuildTopImage', params);
	},
	/**
	 * 获取组织建设内容
	 * @param {Object} params
	 */
	getOrgBuild(params) {
		return postData(ApiBaseUrl + '/partyLead/getOrgBuild', params);
	},
	/**
	 * 获取党员活动顶部背景
	 * @param {Object} params
	 */
	getMemberActivityTopImage(params) {
		return postData(ApiBaseUrl + '/partyLead/getMemberActivityTopImage', params);
	},
	/**
	 * 获取党员活动分页列表
	 * @param {Object} params
	 */
	getMemberActivityPage(params) {
		return postData(ApiBaseUrl + '/partyLead/getMemberActivityPage', params);
	},
	/**
	 * 获取党员活动详情
	 * @param {Object} params
	 */
	getMemberActivityDetail(params) {
		return postData(ApiBaseUrl + '/partyLead/getMemberActivityDetail', params);
	},
	//------------------------------企业概况------------------------------------------------------------------------
	/**
	 * 获取企业简介顶部背景
	 * @param {Object} params
	 */
	getEnterpriseIntroTopImage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseIntroTopImage', params);
	},
	/**
	 * 获取企业简介
	 * @param {Object} params
	 */
	getEnterpriseIntro(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseIntro', params);
	},
	/**
	 * 获取企业荣誉顶部背景
	 * @param {Object} params
	 */
	getEnterpriseHonorTopImage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseHonorTopImage', params);
	},
	/**
	 * 获取企业荣誉
	 * @param {Object} params
	 */
	getEnterpriseHonorPage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseHonorPage', params);
	},
	/**
	 * 获取企业荣誉详情
	 * @param {Object} params
	 */
	getEnterpriseHonorDetail(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseHonorDetail', params);
	},
	/**
	 * 获取发展历程顶部背景
	 * @param {Object} params
	 */
	getDevelopHistoryTopImage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getDevelopHistoryTopImage', params);
	},
	/**
	 * 获取发展历程
	 * @param {Object} params
	 */
	getDevelopHistoryPage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getDevelopHistoryPage', params);
	},
	/**
	 * 获取发展历程详情
	 * @param {Object} params
	 */
	getDevelopHistoryDetail(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getDevelopHistoryDetail', params);
	},
	/**
	 * 获取企业文化顶部背景
	 * @param {Object} params
	 */
	getEnterpriseCultureTopImage(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseCultureTopImage', params);
	},
	/**
	 * 获取企业文化
	 * @param {Object} params
	 */
	getEnterpriseCulture(params) {
		return postData(ApiBaseUrl + '/enterpriseOverview/getEnterpriseCulture', params);
	},
	//-----------------------------------企业新闻------------------------------------------------------------------------------
	/**
	 * 企业动态列表
	 * @param {Object} params
	 */
	enterpriseTrendsList(params) {
		return postData(ApiBaseUrl + '/companyNews/enterpriseTrendsList', params);
	},
	/**
	 * 企业动态查看更多分页列表
	 * @param {Object} params
	 */
	enterpriseTrendsPage(params) {
		return postData(ApiBaseUrl + '/companyNews/enterpriseTrendsPage', params);
	},
	/**
	 * （3）企业动态详情
	 * @param {Object} params
	 */
	enterpriseTrendsDetail(params) {
		return postData(ApiBaseUrl + '/companyNews/enterpriseTrendsDetail', params);
	},
	/**
	 * （4）企业动态顶部背景图
	 * @param {Object} params
	 */
	qydtBgImage(params) {
		return postData(ApiBaseUrl + '/companyNews/qydtBgImage', params);
	},
	/**
	 * 公示公告分页列表
	 * @param {Object} params
	 */
	publicNoticePage(params) {
		return postData(ApiBaseUrl + '/companyNews/publicNoticePage', params);
	},
	/**
	 * （2）公示公告详情
	 * @param {Object} params
	 */
	publicNoticeDetail(params) {
		return postData(ApiBaseUrl + '/companyNews/publicNoticeDetail', params);
	},
	/**
	 * 公示公告顶部背景图
	 * @param {Object} params
	 */
	gsggBgImage(params) {
		return postData(ApiBaseUrl + '/companyNews/gsggBgImage', params);
	},
	/**
	 * 视频展示-轮播
	 * @param {Object} params
	 */
	videoDisplayList(params) {
		return postData(ApiBaseUrl + '/companyNews/videoDisplayList', params);
	},
	/**
	 * 视频展示分页列表
	 * @param {Object} params
	 */
	videoDisplayPage(params) {
		return postData(ApiBaseUrl + '/companyNews/videoDisplayPage', params);
	},
	/**
	 * 视频展示详情
	 * @param {Object} params
	 */
	videoDetail(params) {
		return postData(ApiBaseUrl + '/companyNews/videoDetail', params);
	},

	/**
	 * 视频展示顶部背景图
	 * @param {Object} params
	 */
	videoBgImage(params) {
		return postData(ApiBaseUrl + '/companyNews/videoBgImage', params);
	},
	/**
	 * 搜索
	 * @param {Object} params
	 */
	searchList(params) {
		return postData(ApiBaseUrl + '/search/searchList', params);
	},
	/**
	 * 网站访问量
	 * @param {Object} params
	 */
	visit(params) {
		return postData(ApiBaseUrl + '/search/visit', params);
	},


	//-----------------------------------产品与服务-----------------------------------------------------------------------------
	/**
	 * 获取科技研发顶部背景
	 * @param {Object} params
	 */
	getScienceDevelopTopImage(params) {
		return postData(ApiBaseUrl + '/products/getScienceDevelopTopImage', params);
	},
	/**
	 * 获取科技研发轮播图
	 * @param {Object} params
	 */
	getScienceDevelopCover(params) {
		return postData(ApiBaseUrl + '/products/getScienceDevelopCover', params);
	},
	/**
	 * 获取科技研发分页列表
	 * @param {Object} params
	 */
	getScienceDevelopPage(params) {
		return postData(ApiBaseUrl + '/products/getScienceDevelopPage', params);
	},
	/**
	 * (4)获取科技研发详情
	 * @param {Object} params
	 */
	getScienceDevelopDetail(params) {
		return postData(ApiBaseUrl + '/products/getScienceDevelopDetail', params);
	},
	/**
	 * 获取销售公告顶部背景
	 * @param {Object} params
	 */
	getSaleNoticeTopImage(params) {
		return postData(ApiBaseUrl + '/products/getSaleNoticeTopImage', params);
	},
	/**
	 * 获取销售公告分页列表
	 * @param {Object} params
	 */
	getSaleNoticePage(params) {
		return postData(ApiBaseUrl + '/products/getSaleNoticePage', params);
	},
	/**
	 * 获取销售公告详情
	 * @param {Object} params
	 */
	getSaleNoticeDetail(params) {
		return postData(ApiBaseUrl + '/products/getSaleNoticeDetail', params);
	},
	/**
	 * 获取销售区域顶部背景
	 * @param {Object} params
	 */
	getSalesAreaTopImage(params) {
		return postData(ApiBaseUrl + '/products/getSalesAreaTopImage', params);
	},
	/**
	 * 获取销售区域顶部背景
	 * @param {Object} params
	 */
	getSalesAreaPage(params) {
		return postData(ApiBaseUrl + '/products/getSalesAreaPage', params);
	},
	/**
	 * 企业实力
	 * @param {Object} params
	 */
	qyslInfo(params) {
		return postData(ApiBaseUrl + '/products/qyslInfo', params);
	},
	/**
	 * 企业实力顶部背景图
	 * @param {Object} params
	 */
	qyslBgImage(params) {
		return postData(ApiBaseUrl + '/products/qyslBgImage', params);
	},
	/**
	 * 主营产品-产品分类
	 * @param {Object} params
	 */
	productClassify(params) {
		return postData(ApiBaseUrl + '/products/productClassify', params);
	},
	/**
	 * 主营产品-背景图
	 * @param {Object} params
	 */
	productBgImage(params) {
		return postData(ApiBaseUrl + '/products/productBgImage', params);
	},
	/**
	 * 主营产品-根据分类查询产品列表
	 * @param {Object} params
	 */
	productMainList(params) {
		return postData(ApiBaseUrl + '/products/productMainList', params);
	},
	/**
	 * 主营产品-查看更多
	 * @param {Object} params
	 */
	productMainDetail(params) {
		return postData(ApiBaseUrl + '/products/productMainDetail', params);
	},
	/**
	 * 主营产品-顶部背景图
	 * @param {Object} params
	 */
	productBgImage(params) {
		return postData(ApiBaseUrl + '/products/productBgImage', params);
	},

	//-----------------------采购信息-------------------------------------------------------------------------------------------
	/**
	 * 获取重要公告顶部背景
	 * @param {Object} params
	 */
	getImportantNoticeTopImage(params) {
		return postData(ApiBaseUrl + '/purchase/getImportantNoticeTopImage', params);
	},
	/**
	 * 获取重要公告分页列表
	 * @param {Object} params
	 */
	getImportantNoticePage(params) {
		return postData(ApiBaseUrl + '/purchase/getImportantNoticePage', params);
	},
	/**
	 * (3)获取重要公告详情
	 * @param {Object} params
	 */
	getImportantNoticeDetail(params) {
		return postData(ApiBaseUrl + '/purchase/getImportantNoticeDetail', params);
	},
	/**
	 * 获取招标公告顶部背景
	 * @param {Object} params
	 */
	getInviteNoticeTopImage(params) {
		return postData(ApiBaseUrl + '/purchase/getInviteNoticeTopImage', params);
	},
	/**
	 *获取招标公告分页列表
	 * @param {Object} params
	 */
	getInviteNoticePage(params) {
		return postData(ApiBaseUrl + '/purchase/getInviteNoticePage', params);
	},
	/**
	 *获取招标公告详情
	 * @param {Object} params
	 */
	getInviteNoticeDetail(params) {
		return postData(ApiBaseUrl + '/purchase/getInviteNoticeDetail', params);
	},
	/**
	 *获取中标公告顶部背景
	 * @param {Object} params
	 */
	getWinNoticeTopImage(params) {
		return postData(ApiBaseUrl + '/purchase/getWinNoticeTopImage', params);
	},
	/**
	 *获取中标公告顶部背景
	 * @param {Object} params
	 */
	getWinNoticePage(params) {
		return postData(ApiBaseUrl + '/purchase/getWinNoticePage', params);
	},
	/**
	 *(3)获取中标公告详情
	 * @param {Object} params
	 */
	getWinNoticeDetail(params) {
		return postData(ApiBaseUrl + '/purchase/getWinNoticeDetail', params);
	},
	/**
	 *获取流标公告顶部背景
	 * @param {Object} params
	 */
	getFailNoticeTopImage(params) {
		return postData(ApiBaseUrl + '/purchase/getFailNoticeTopImage', params);
	},
	/**
	 *(2)获取流标公告分页列表
	 * @param {Object} params
	 */
	getFailNoticePage(params) {
		return postData(ApiBaseUrl + '/purchase/getFailNoticePage', params);
	},
	/**
	 *(3)获取流标公告详情
	 * @param {Object} params
	 */
	getFailNoticeDetail(params) {
		return postData(ApiBaseUrl + '/purchase/getFailNoticeDetail', params);
	},
	//------------------------人才中心---------------------------------------------------------------------------------------------
	/**
	 *获取人才理念顶部背景
	 * @param {Object} params
	 */
	getTalentConceptTopImage(params) {
		return postData(ApiBaseUrl + '/talent/getTalentConceptTopImage', params);
	},
	/**
	 *获取人才理念内容
	 * @param {Object} params
	 */
	getTalentConcept(params) {
		return postData(ApiBaseUrl + '/talent/getTalentConcept', params);
	},
	/**
	 *获取薪酬福利顶部背景
	 * @param {Object} params
	 */
	getSalaryBenefitsTopImage(params) {
		return postData(ApiBaseUrl + '/talent/getSalaryBenefitsTopImage', params);
	},
	/**
	 *获取薪酬福利内容
	 * @param {Object} params
	 */
	getSalaryBenefits(params) {
		return postData(ApiBaseUrl + '/talent/getSalaryBenefits', params);
	},
	/**
	 *(1)获取职业发展顶部背景
	 * @param {Object} params
	 */
	getCareerDevelopmentTopImage(params) {
		return postData(ApiBaseUrl + '/talent/getCareerDevelopmentTopImage', params);
	},
	/**
	 *(2)获取职业发展内容
	 * @param {Object} params
	 */
	getCareerDevelopment(params) {
		return postData(ApiBaseUrl + '/talent/getCareerDevelopment', params);
	},
	/**
	 *获取在线留言顶部背景
	 * @param {Object} params
	 */
	getOnlineMessageTopImage(params) {
		return postData(ApiBaseUrl + '/talent/getOnlineMessageTopImage', params);
	},
	/**
	 *获取在线留言顶部背景
	 * @param {Object} params
	 */
	getContactInfo(params) {
		return postData(ApiBaseUrl + '/talent/getContactInfo', params);
	},
	/**
	 *提交在线留言
	 * @param {Object} params
	 */
	saveOnlineMessage(params) {
		return postData(ApiBaseUrl + '/talent/saveOnlineMessage', params);
	},

	/**
	 *人力公告分页列表
	 * @param {Object} params
	 */
	recruitNoticePage(params) {
		return postData(ApiBaseUrl + '/talent/recruitNoticePage', params);
	},
	/**
	 *（2）人力公告-查看更多详情
	 * @param {Object} params
	 */
	recruitNoticeDetail(params) {
		return postData(ApiBaseUrl + '/talent/recruitNoticeDetail', params);
	},
	/**
	 *人力公告-顶部背景图
	 * @param {Object} params
	 */
	rlGgBgImage(params) {
		return postData(ApiBaseUrl + '/talent/rlGgBgImage', params);
	},
	/**
	 *招聘信息-根据招聘人群查询岗位分类
	 * @param {Object} params
	 */
	jobClassifyList(params) {
		return postData(ApiBaseUrl + '/talent/jobClassifyList', params);
	},
	/**
	 *招聘信息-根据岗位分类查询岗位信息列表
	 * @param {Object} params
	 */
	recruitPublishList(params) {
		return postData(ApiBaseUrl + '/talent/recruitPublishList', params);
	},
	/**
	 *招聘信息-顶部背景图
	 * @param {Object} params
	 */
	zpXxBgImage(params) {
		return postData(ApiBaseUrl + '/talent/zpXxBgImage', params);
	},
	/**
	 *招聘信息-招聘简章
	 * @param {Object} params
	 */
	getRecruitPublishDetail(params) {
		return postData(ApiBaseUrl + '/talent/getRecruitPublishDetail', params);
	},
	/**
	 *在线留言-联系方式
	 * @param {Object} params
	 */
	getContactInfo(params) {
		return postData(ApiBaseUrl + '/talent/getContactInfo', params);
	},

	/**
	 *报名入口-应聘岗位列表
	 * @param {Object} params
	 */
	jobList(params) {
		return postData(ApiBaseUrl + '/talent/jobList', params);
	},
	/**
	 *报名入口
	 * @param {Object} params
	 */
	onlineJob(params) {
		return postData(ApiBaseUrl + '/talent/onlineJob', params);
	},
	/**
	 *上传图片
	 * @param {Object} params
	 */
	uploadFile(params) {
		return postData(ApiBaseUrl + '/upload/uploadFile', params);
	},

	//------------------------------------联系我们---------------------------------------------------------
	/**
	 *获取联系方式顶部背景
	 * @param {Object} params
	 */
	getContactUsTopImage(params) {
		return postData(ApiBaseUrl + '/contact/getContactUsTopImage', params);
	},
	/**
	 *获取联系方式内容
	 * @param {Object} params
	 */
	getContactUs(params) {
		return postData(ApiBaseUrl + '/contact/getContactUs', params);
	},
	/**
	 *获取投诉建议顶部背景
	 * @param {Object} params
	 */
	getComplaintAdviceTopImage(params) {
		return postData(ApiBaseUrl + '/contact/getComplaintAdviceTopImage', params);
	},
	//------------------------------------可持續發展---------------------------------------------------------
	/**
	 *保存投诉建议内容
	 * @param {Object} params
	 */
	saveComplaintAdvice(params) {
		return postData(ApiBaseUrl + '/contact/saveComplaintAdvice', params);
	},



	/**
	 *获取可持续发展develop/getGreenDevelopmentTopImage
	 * @param {Object} params
	 */
	getGreenDevelopmentPage(params) {
		return postData(ApiBaseUrl + '/develop/getGreenDevelopmentPage', params);
	},
	/**
	 *获取绿色发展顶部背景图片
	 * @param {Object} params
	 */
	getGreenDevelopmentTopImage(params) {
		return postData(ApiBaseUrl + '/develop/getGreenDevelopmentTopImage', params);
	},
	/**
	 *获取环保信息顶部背景
	 * @param {Object} params
	 */
	getEnvironmentalInfoTopImage(params) {
		return postData(ApiBaseUrl + '/develop/getEnvironmentalInfoTopImage', params);
	},
	/**
	 *获取可持续发展
	 * @param {Object} params
	 */
	getEnvironmentalInfoPage(params) {
		return postData(ApiBaseUrl + '/develop/getEnvironmentalInfoPage', params);
	},

	/**
	 *获取可持续发展-http://127.0.0.1:9999/openApi/develop/getGreenDevelopmentDetail-详情
	 * @param {Object} params
	 */
	getGreenDevelopmentDetail(params) {
		return postData(ApiBaseUrl + '/develop/getGreenDevelopmentDetail', params);
	},


	/**
	 *获取可持续发展-环保信息-详情
	 * @param {Object} params
	 */
	getEnvironmentalInfoDetail(params) {
		return postData(ApiBaseUrl + '/develop/getEnvironmentalInfoDetail', params);
	},

	//------------------------------------------------------------------------------------------------------------
	/**
	 * 拼接项目图片路径地址URL host
	 */
	getImgUrl() {
		return ''; //host;
	},
	getBaseApi() {
		return ApiBaseUrl;
	},
	formartContent(str, length) {
		if (str) {
			let replacestr = this.cleanText(str);
			if (length) {
				return replacestr.substring(0, replacestr.length < length ? replacestr.length : length);
			}
			return replacestr;
		}
		return str;
	},
	cleanText(htmlText) {
		htmlText = htmlText.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&nbsp;/g, " ");
		const sanitizedHTML = DOMPurify.sanitize(htmlText);
		const div = document.createElement('div');
		div.innerHTML = sanitizedHTML;
		return div.textContent || div.innerText || '';
	},

	autoTable() {
		const tables = document.querySelectorAll('table');
		tables.forEach(table => {
			table.style.width = '100%';
			table.style.margin = '0 auto';
		});
	},
	setImageMaxwidth(objClassName) {
		const images = document.querySelectorAll('.content_bg '+objClassName);
		images.forEach(image => {
			if (window.innerWidth <= 768) {
				image.style.maxWidth = '100%';
				
			} else {
				image.style.maxWidth = '70%';
			}
			image.style.height = "auto";
			if(image.style.width/image.parentNode.style.width>0.7){
				image.style.height = "auto";
			}
			
			image.parentNode.style.textAlign = "center"
		});
	},
	setPMaxContent() {
		const items = document.querySelectorAll('p');
		items.forEach(item => {
			item.style.height = 'max-content';
		});
	},
	checkIsMobile() {
		if (window.innerWidth <= 440) {
			return true;
		} else {
			return false;
		}
	},
	handleLoadDataPreView() {
		// if(window.innerWidth<=430){
		// 	const videos = document.querySelectorAll('video');
		// 	videos.forEach(video => { 
		// 		video.load();
		// 		video.poster=video.preview
		// 	});
		// } 
	},
}
